Results

Row

Grade

School

Row

Screening Results

---
title: "Winter 2022 Thursday Hearing Screenings"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
    vertical_layout: scroll
    theme: 
      version: 4
      bg: "#101010"
      fg: "#101010" 
      primary: "#ED79F9"
      navbar-bg: "#3ADAC6"
      
---

```{r setup, include=FALSE}
library(flexdashboard)
```

```{r, include=FALSE}
library(tidyverse)
library(here)
library(janitor)
library(rio)
library(colorblindr)
library(gghighlight)
library(forcats)
library(ggrepel)
library(gt)
library(knitr)
library(kableExtra)
library(reactable)
library(plotly)
library(glue)
library(fs)
library(rstatix)
library(ggpubr)
library(writexl)
library(remotes)
library(profvis)

theme_set(theme_minimal(15) +
            theme(legend.position = "bottom",
                  panel.grid.major.x = element_line(colour = "gray60"),
                  panel.grid.minor.x = element_blank(),
                  panel.grid.major.y = element_blank())
          )

```

```{r, include=FALSE}
ear <- import(here("data", "hearing_screening.sav"),
               setclass = "tbl_df") %>% 
  characterize() %>% 
  janitor::clean_names() %>% 
  mutate(grade = as.factor(grade),
         school = as.factor(school),
         screen_res = as.factor(screen_res))

str(ear)

ear$grade <- factor(ear$grade, levels = c("kindergarten",
                                          "1st grade"))

ear$screen_res <- factor(ear$screen_res, levels = c("pass",
                                                    "pass with OAE",
                                                    "refer",
                                                    "absent"))


ear_res <- ear %>% 
  group_by(grade, school) %>% 
  count(screen_res)

ear %>% 
  group_by(screen_res) %>% 
  count()
```

# Results 

Row {.tabset}
-----------------------------------------------------------------------

### Grade 

```{r, include=FALSE}
ear_grade <- ear %>% 
  group_by(grade) %>% 
  count() 

ear_school <- ear %>% 
  group_by(school) %>% 
  count()

```

```{r, include=FALSE}
grd_tbl <- ear_grade %>% 
  reactable(columns = list(
    grade = colDef(name = "Grade",
                   align = "center"),
    n = colDef(name = "Total",
               align = "center",
               format = colFormat(suffix = " students"))
  ),
  striped = TRUE,
  outlined = TRUE,
  compact = TRUE,
  highlight = TRUE,
  bordered = TRUE)

sch_tbl <- ear_school %>% 
  reactable(columns = list(
    school = colDef(name = "School",
                   align = "center"),
    n = colDef(name = "Total",
               align = "center",
               format = colFormat(suffix = " students"))
  ),
  striped = TRUE,
  outlined = TRUE,
  compact = TRUE,
  highlight = TRUE,
  bordered = TRUE)
```

```{r, include=TRUE}
grd_tbl
```

### School

```{r, include=TRUE}
sch_tbl
```



Row {.tabset}
-----------------------------------------------------------------------

### Screening Results 

```{r, include=FALSE}

res_tbl <- ear_res %>% 
  reactable(columns = list(
    grade = colDef(name = "Grade",
                   align = "center"),
    school = colDef(name = "School",
                    align = "center"),
    screen_res = colDef(name = "Screening Result",
                        align = "center"),
    n = colDef(name = "Total",
               align = "center",
               format = colFormat(suffix = " students"))),
  striped = TRUE,
  outlined = TRUE,
  compact = TRUE,
  highlight = TRUE,
  bordered = TRUE,
  searchable = TRUE)



```

```{r, include=TRUE}
res_tbl
```